#include <allegro.h>
#include "menu.h"


void touches (BITMAP *Buffer,BITMAP *menu[6], BITMAP *bleu, int *i)
{

while (!key[KEY_ESC])
{
blit(menu[0], Buffer, 0, 0, 0, 0, menu[0]->w, menu[0]->h);
blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);

if ((*i)==6) 
{
(*i)=1;
}

if (key[KEY_DOWN])
{
usleep(90000);
draw_sprite(menu[0], menu[(*i)],0,0);
blit(Buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
(*i)++;
}


if(key[KEY_ENTER])
{
draw_sprite(menu[0], bleu,0,0);//bleu kenet menu[0]
}

}

}


void load (BITMAP *menu[6])
{
menu[0]=load_bitmap("menu0.bmp",NULL);
menu[1]=load_bitmap("menu1.bmp",NULL);
menu[2]=load_bitmap("menu2.bmp",NULL);
menu[3]=load_bitmap("menu3.bmp",NULL);
menu[4]=load_bitmap("menu4.bmp",NULL);
menu[5]=load_bitmap("menu5.bmp",NULL);

if (menu[0] == NULL) {
allegro_message("could not load images");
allegro_exit();
}
}
